package ferp.core.ai.nn.bp.activation;

/**
 * User: igorgok
 * Date: 12/2/13 3:42 PM
 */
public class Sigmoid implements Activation
{
  public static final Activation instance = new Sigmoid();

  @Override
  public double activate(double d)
  {
    return 1. / (1. + Math.exp(-d));
  }

  @Override
  public double derivative(double d)
  {
    return d * (1 - d);
  }

  // singleton
  protected Sigmoid() {}
}
